<?php

function send_mail($subject, $content, $from_mail, $to_mail, $html, $from_name)
{
	if($html)
		$format = "text/html";
	else
		$format = "text/plain";

	$mailheader = "From: $from_name <$from_mail>\r\n";
	$mailheader .= "Reply-To: $from_mail\r\n";
	$mailheader .= "MIME-Version: 1.0\r\n";
	
	$result = "<result><status>";
	if(mail($to_mail, $subject, $content, $mailheader))
		$result .= "true";
	else
		$result .= "false";
	
	$result .= "</status></result>";
	
	return $result;
}

echo send_mail($_POST['subject'], $_POST['content'], $_POST['from_mail'], $_POST['to_mail'], $_POST['html'], $_POST['from_name']);

?>

